#include <QDebug>

bool VolumePlayHnalder(int socket, int commandLength)
{
	qDebug()<<"Receive volume plamn"
	unsigned long volumeListXmlLength;

	if(!getFourByte(m_Socket, volumeListXmlLength))
	{
		qDebug()<<"Get Volume list xml file length error";
		errorExit();
	}

	char* xmlBuffer = new char[volumeListXmlLength];
	boost::scoped_array<char> xmlBufferContainer(xmlBuffer);

	if(!receiveData(m_Socket, xmlBuffer, volumeListXmlLength))
	{
		qDebug()<<"Get Volume xml data error";
		errorExit();
	}

	QDomDocument document;
	document.setContent(QByteArray(xmlBuffer, volumeListXmlLength));

	QFile volumePlanFile(g_VolumeListFileName);
	if(!volumePlanFile.open(QFile::WriteOnly))
	{
		qDebug()<<"Open volume list file to write error";
	}
	else
	{
		QTextStream stream(&volumePlanFile);
		document.save(stream, 4);
	}
	volumePlanFile.close();

	VolumePlan volumePlan(document);
	volumePlan.doCommand();
}
